package July;

import javax.swing.text.StyleContext;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Day0712 {

    //数组中出现次数超过一半的数字
    public int MoreThanHalfNum_Solution (int[] numbers) {
        // write code here
        HashMap<Integer,Integer> hashMap = new HashMap<>();
        int l = numbers.length/2;
        for (int i = 0; i < numbers.length; i++) {
            int t = hashMap.getOrDefault(numbers[i],0)+1;

            if (t > l)
                return numbers[i];
            hashMap.put(numbers[i],t);
        }
        return -1;
    }


    //字符串中找出连续最长的数字串

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        while(sc.hasNextLine()){
            String str= sc.nextLine();
            //分割数字与字符
            String[] strs = str.split("[^0-9]");
            int max = 0;
            for(int i = 0;i<strs.length;i++){
                if(max<strs[i].length())
                    max = strs[i].length();
            }
            String result = "";
            for(int i =0;i<strs.length;i++){
                if(strs[i].length()==max)
                    result+=strs[i];
            }
            System.out.println(result);
        }
    }
}
